<?php

require_once PATH_ZFEXTEND . '/lib/Hazel/Hazel_Validator_Cpf.php';

class ZFKiller_Form_Element_Cpf extends ZFKiller_Form_Element_Text {

	public function __construct($spec, $options = null) {
		ZFKiller_Form_Element::formatDefaultOptions($spec, $options);

		if (!isset($options['label'])) {
			$options['label'] = 'Cpf';
		}

		parent::__construct($spec, $options);

		$this->addValidator(new ZFKiller_Validate_Cpf())
				->addFilter(new Zend_Filter_Digits());

		ZFKiller_Form_Element::formatElementAsText($this);
	}

}